package com.test;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
import java.util.Set;

import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class MyJob implements Job{

	@Override
	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		System.out.println("It's Time for me to run!!WUHA╰_╯");
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        
        JobDetail jd = arg0.getJobDetail();
        JobDataMap jdm = jd.getJobDataMap();
        Set<String> set = jdm.keySet();
        
        for(String s : set){
        	 System.out.println(s);
        }
        
        java.util.Random r = (java.util.Random)arg0.getJobDetail().getJobDataMap().get("from");
        System.out.println("content :"+ r.nextInt(100));
        
        System.out.println("now time is:"+format.format(new Date()));
	
        
	}

}
